﻿@model int

<img src="@Url.Content("~/Content/star.jpg")" />
<span id="@("Rating" + ViewBag.OnController + ViewBag.onAction + ViewBag.Id)" style="color:#FC9605">@Model</span>
    
@if (ViewBag.CanRate)
{
    <span id="@("RatingButton" + ViewBag.Id)">
    (
        

        @Ajax.ActionLink("+", "RatingOn", "Home", new
        {           
            id = (int)ViewBag.Id,
            isPlus = true,
            onController = ViewBag.OnController,
            onAction = ViewBag.onAction
        }, new AjaxOptions
        {
            HttpMethod="POST",
            UpdateTargetId = "Rating" + ViewBag.OnController + ViewBag.onAction + ViewBag.Id,
            OnComplete = User.IsInRole("Admin") ? "" : "$('#RatingButton" + ViewBag.Id + "').hide()"
        },
         new { @class = "NonUnderLineLink", rel = "nofollow" }) 
        /
        @Ajax.ActionLink("-", "RatingOn", "Home", new
        {
            id = (int)ViewBag.Id,
            isPlus = false,
            onController = ViewBag.OnController,
            onAction = ViewBag.onAction
        }
        , new AjaxOptions
        {            
            HttpMethod = "POST",
            UpdateTargetId = "Rating" + ViewBag.OnController + ViewBag.onAction + ViewBag.Id,
            OnComplete = User.IsInRole("Admin") ? "" : "$('#RatingButton" + ViewBag.Id + "').hide()"
        }, new
        {
            @class = "NonUnderLineLink",
            rel = "nofollow"
        })
    )
    </span>
}